/**
 * Created by chang on 2017/7/11.
 */

const HOST = '/';

export default class Api {
    static SUCCESS_CODE = 0;

    static X_OSS_PROCESS = (uri, v, circle = false) => {
        return `${uri}?x-oss-process=image/resize,h_${v}/format,jpg${circle ? '/circle,r_' + v : ''}`
    };

    static DEFAULT_USER_PIC = 'http://ytmd-library.oss-cn-beijing.aliyuncs.com/user/image/2a/ab/2aab-40e4-8477-9125b4c5516e-91d38c2e82fe-d41d8.png';

    // 用户登录
    static USER_LOGIN = {
        url: HOST + 'admin/user/check-user-login',
        method: 'get'
    };

    // 获取连接数
    static MODEL_CONNECTION_LIST = {
        url: HOST + 'admin/model/connection-list',
        method: 'get'
    };

    // 获取模型列表
    static MODEL_DB_TABLES = {
        url: HOST + 'admin/model/db-tables',
        method: 'get'
    };

    // 生成模型
    static MODEL_GEN = {
        url: HOST + 'admin/model/gen-models',
        method: 'post'
    };

    // 获取用户列表
    static USER_LIST = {
        url: HOST + 'admin/user/query',
        method: 'get'
    };

    // 获取上传token
    static UPLOAD_POLICY = {
        url: HOST + 'api/common/file/upload-policy',
        method: 'get'
    };

    // 获取文件file key
    static UPLOAD_FILE_KEY = {
        url: HOST + 'api/common/file/upload-file-key',
        method: 'get'
    };

    // 编辑用户信息
    static USER_SAVE = {
        url: HOST + 'admin/user/save',
        method: 'post'
    };

    // 删除用户-真删
    static USER_DELETE = {
        url: HOST + 'admin/user/delete',
        method: 'get'
    };

    // 修改密码
    static USER_RESET_PASSWORD = {
        url: HOST + 'admin/user/reset-password',
        method: 'get'
    };

    static USER_STAT_HOME = {
        url: HOST + 'admin/user/user-stat',
        method: 'get'
    };

    static USER_STAT_BRIEF = {
        url: HOST + 'admin/user/stat-brief',
        method: 'get'
    };

    // 获取键值常量
    static CONST_KV_GET = {
        url: HOST + 'admin/setting/const-kv',
        method: 'get'
    };

    // 设置键值常量
    static CONST_KV_SET = {
        url: HOST + 'admin/setting/const-kv',
        method: 'post'
    };

    // 导航管理列表
    static CONTENT_NAV_LIST = {
        url: HOST + 'admin/content/nav-list',
        method: 'get'
    };

    // 导航列表修改
    static CONTENT_NAV_SAVE = {
        url: HOST + 'admin/content/nav-save',
        method: 'post'
    };

    static CONTENT_NAV_SORT = {
        url: HOST + 'admin/content/nav-sort',
        method: 'post'
    };

    // 类别导航列表
    static CONTENT_NAV_CAT_LIST = {
        url: HOST + 'admin/content/nav-cat-list',
        method: 'get'
    };

    // 类别导航修改
    static CONTENT_NAV_CAT_SAVE = {
        url: HOST + 'admin/content/nav-cat-save',
        method: 'post'
    };
    // 类别导航删除
    static CONTENT_NAV_CAT_DELETE = {
        url: HOST + 'admin/content/nav-cat-delete',
        method: 'get'
    };

    static CONTENT_NAV_CAT_SORT = {
        url: HOST + 'admin/content/nav-cat-sort',
        method: 'post'
    };

    // 轮播图列表
    static CONTENT_BANNER_LIST = {
        url: HOST + 'admin/content/home-banner-list',
        method: 'get'
    };

    // 轮播图修改
    static CONTENT_BANNER_SAVE = {
        url: HOST + 'admin/content/home-banner-save',
        method: 'post'
    };

    static CONTENT_BANNER_SORT = {
        url: HOST + 'admin/content/home-banner-sort',
        method: 'post'
    };

    static CONTENT_BANNER_DELETE = {
        url: HOST + 'admin/content/home-banner-delete',
        method: 'get'
    };

    // 首页栏目列表
    static CONTENT_COLUMN_LIST = {
        url: HOST + 'admin/content/home-column-list',
        method: 'get'
    };

    // 首页栏目保存
    static CONTENT_COLUMN_SAVE = {
        url: HOST + 'admin/content/home-column-save',
        method: 'post'
    };

    static CONTENT_COLUMN_SORT = {
        url: HOST + 'admin/content/home-column-sort',
        method: 'post'
    };


    static CONTENT_RECOMMEND_LIST = {
        url: HOST + 'admin/content/recommend-list',
        method: 'get'
    };

    static CONTENT_RECOMMEND_SAVE = {
        url: HOST + 'admin/content/recommend-save',
        method: 'post'
    };

    static CONTENT_RECOMMEND_SORT = {
        url: HOST + 'admin/content/recommend-sort',
        method: 'post'
    };

    static CONTENT_RECOMMEND_DETAIL_LIST = {
        url: HOST + 'admin/content/recommend-detail-list',
        method: 'get'
    };

    static CONTENT_RECOMMEND_DETAIL_SAVE = {
        url: HOST + 'admin/content/recommend-detail-save',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    };

    static CONTENT_RECOMMEND_DETAIL_SORT = {
        url: HOST + 'admin/content/recommend-detail-sort',
        method: 'post'
    };

    static CONTENT_RECOMMEND_DETAIL_DELETE = {
        url: HOST + 'admin/content/recommend-detail-delete',
        method: 'get'
    };


    static CONTENT_TRANSFER_LIST = {
        url: HOST + 'admin/content/transfer-list',
        method: 'get'
    };

    static CONTENT_TRANSFER_SAVE = {
        url: HOST + 'admin/content/transfer-save',
        method: 'post'
    };

    static CONTENT_TRANSFER_SORT = {
        url: HOST + 'admin/content/transfer-sort',
        method: 'post'
    };

    static CONTENT_TRANSFER_DETAIL_LIST = {
        url: HOST + 'admin/content/transfer-detail-list',
        method: 'get'
    };

    static CONTENT_TRANSFER_DETAIL_SAVE = {
        url: HOST + 'admin/content/transfer-detail-save',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    };

    static CONTENT_TRANSFER_DETAIL_SORT = {
        url: HOST + 'admin/content/transfer-detail-sort',
        method: 'post'
    };

    static CONTENT_TRANSFER_DETAIL_DELETE = {
        url: HOST + 'admin/content/transfer-detail-delete',
        method: 'get'
    };

    static CONTENT_NEWS_LIST = {
        url: HOST + 'admin/content/news-list',
        method: 'get'
    };

    static CONTENT_NEWS_SAVE = {
        url: HOST + 'admin/content/news-save',
        method: 'post'
    };

    static CONTENT_NEWS_DELETE = {
        url: HOST + 'admin/content/news-delete',
        method: 'get'
    };

    static CONTENT_DESIGN_DEMO_CATEGORY_LIST = {
        url: HOST + 'admin/content/design-demo-category-list',
        method: 'get'
    };

    static CONTENT_DESIGN_DEMO_CATEGORY_SAVE = {
        url: HOST + 'admin/content/design-demo-category-save',
        method: 'post'
    };


    static CONTENT_DESIGN_DEMO_LIST = {
        url: HOST + 'admin/content/design-demo-list',
        method: 'get'
    };

    static CONTENT_DESIGN_DEMO_SAVE = {
        url: HOST + 'admin/content/design-demo-save',
        method: 'post'
    };

    static CONTENT_DESIGN_DEMO_DELETE = {
        url: HOST + 'admin/content/design-demo-delete',
        method: 'get'
    };

    static CONTENT_FRIEND_LINK_LIST = {
        url: HOST + 'admin/content/friend-link-list',
        method: 'get'
    };

    static CONTENT_FRIEND_LINK_SAVE = {
        url: HOST + 'admin/content/friend-link-save',
        method: 'post'
    };

    static CONTENT_FRIEND_LINK_DELETE = {
        url: HOST + 'admin/content/friend-link-delete',
        method: 'get'
    };


    // brand --------------------------------------------------------
    // 商标列表
    static BRAND_LIST = {
        url: HOST + 'admin/brand/list',
        method: 'get',

    };

    static BRAND_SAVE = {
        url: HOST + 'admin/brand/save',
        method: 'post'
    };

    static BRAND_BATCH_TOP = {
        url: HOST + 'admin/brand/batch-top',
        method: 'post'
    };

    static BRAND_BATCH_DELETE = {
        url: HOST + 'admin/brand/batch-delete',
        method: 'post'
    };

    static BRAND_SAVE_BATCH = {
        url: HOST + 'admin/brand/save-batch',
        method: 'post'
    };

    // 商标分类列表
    static BRAND_CATEGORY_LIST = {
        url: HOST + 'admin/brand/category-list',
        method: 'get'
    };

    // 保存推标记录
    static BRAND_PUSH_SAVE = {
        url: HOST + 'admin/brand/save-push-history',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    };

    // 推标历史记录
    static BRAND_PUSH_LIST = {
        url: HOST + 'admin/brand/push-history-list',
        method: 'get'
    };

    // 单个标详情 -- 用于用户展示
    static BRAND_PUSH_DELETE = {
        url: HOST + 'admin/brand/delete-push-main',
        method: 'get'
    };

    // 清空推标历史
    static BRAND_PUSH_CLEAR = {
        url: HOST + 'admin/brand/clear-push-main',
        method: 'get'
    };

    // 商标操作历史
    static BRAND_LOG = {
        url: HOST + 'admin/brand/brand-log',
        method: 'get'
    };

    // 商标搜索
    static BRAND_SEARCH = {
        url: HOST + 'admin/brand/tmkoo-search',
        method: 'get'
    };

    // 商标入库
    static BRAND_ADD = {
        url: HOST + 'admin/brand/add',
        method: 'post'
    };

    // 下载报价单
    static DOWNLOAD_PRICE_EXPORT = {
        url: HOST + 'admin/brand/export-price-xls',
        method: 'post'
    };

    // 修改商标分类
    static BRAND_CLASS_UPDATE = {
        url: HOST + 'admin/brand/brand-class-update',
        method: 'post'
    };

    // kv --------------------------------------------------------
    // 常量
    // 商标操作历史
    static KV_GET = {
        url: HOST + 'admin/kv/value',
        method: 'get'
    };

    // 商标操作历史
    static KV_SET = {
        url: HOST + 'admin/kv/set',
        method: 'post'
    };

    // order -----------------------------------------------------
    static ORDER_LIST = {
        url: HOST + 'admin/order/order-list',
        method: 'get'
    };

    static ORDER_UPDATE = {
        url: HOST + 'admin/order/order-update',
        method: 'post'
    };

    static ORDER_DETAIL = {
        url: HOST + 'admin/order/order-detail',
        method: 'post'
    };

    static ORDER_UPLOAD_CONTRACT = {
        url: HOST + 'admin/order/upload-contract',
        method: 'post'
    };
    static ORDER_UPLOAD_NOTARIZATION = {
        url: HOST + 'admin/order/upload-notarization',
        method: 'post'
    };
    static ORDER_DELETE_CONTRACT = {
        url: HOST + 'admin/order/delete-contract',
        method: 'post'
    };
    static ORDER_DELETE_NOTARIZATION = {
        url: HOST + 'admin/order/delete-notarization',
        method: 'post'
    };
    static ORDER_PRE_OFF_LINE = {
        url: HOST + 'admin/order/pay-offline',
        method: 'post'
    };
    static ORDER_MODIFY_PRICE = {
        url: HOST + 'admin/order/modify-price',
        method: 'post'
    };

    // promotion -------------------------------------------------
    static PROMOTION_ACTIVITY_LIST = {
        url: HOST + 'admin/promotion/activity-list',
        method: 'get'
    };
    static PROMOTION_ACTIVITY_SAVE = {
        url: HOST + 'admin/promotion/activity-save',
        method: 'post'
    };
    static PROMOTION_ACTIVITY_DELETE = {
        url: HOST + 'admin/promotion/activity-delete',
        method: 'get'
    };

    static PROMOTION_SECOND_LIST = {
        url: HOST + 'admin/promotion/second-list',
        method: 'get'
    };

    static PROMOTION_SECOND_SAVE = {
        url: HOST + 'admin/promotion/second-save',
        method: 'post'
    };

    static PROMOTION_SECOND_SORT = {
        url: HOST + 'admin/promotion/second-sort',
        method: 'post'
    };

    static PROMOTION_SECOND_DELETE = {
        url: HOST + 'admin/promotion/second-delete',
        method: 'get'
    };

    static PROMOTION_SECOND_DETAIL_LIST = {
        url: HOST + 'admin/promotion/second-detail-list',
        method: 'get'
    };

    static PROMOTION_SECOND_RANDOM_SELECT = {
        url: HOST + 'admin/promotion/second-random-select',
        method: 'post'
    };

    static PROMOTION_SECOND_DETAIL_SAVE = {
        url: HOST + 'admin/promotion/second-detail-save',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    };

    static PROMOTION_SECOND_DETAIL_SORT = {
        url: HOST + 'admin/promotion/second-detail-sort',
        method: 'post'
    };

    static PROMOTION_SECOND_DETAIL_DELETE = {
        url: HOST + 'admin/promotion/second-detail-delete',
        method: 'get'
    };

    static PROMOTION_ACTIVITY_DETAIL_LIST = {
        url: HOST + 'admin/promotion/activity-detail-list',
        method: 'get'
    };

    static PROMOTION_ACTIVITY_DETAIL_SAVE = {
        url: HOST + 'admin/promotion/activity-detail-save',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    };

    static PROMOTION_ACTIVITY_DETAIL_DELETE = {
        url: HOST + 'admin/promotion/activity-detail-delete',
        method: 'get'
    };

    static PROMOTION_ACTIVITY_DETAIL_SORT = {
        url: HOST + 'admin/promotion/activity-detail-sort',
        method: 'post'
    };

    // other -------------------------------------------------
    static OTHER_FIRST_STEP_LIST = {
        url: HOST + 'admin/other/first-step-list',
        method: 'get'
    };
    static OTHER_FIRST_DESIGN_LIST = {
        url: HOST + 'admin/other/first-design-list',
        method: 'get'
    };
    static OTHER_FIRST_SEARCH_LIST = {
        url: HOST + 'admin/other/first-search-list',
        method: 'get'
    };

    // 消息通知
    static OTHER_UN_READ_DEMAND = {
        url: HOST + 'admin/other/un-read-demand',
        method: 'get'
    };

    //
    static OTHER_MAKE_ALL_AS_READ = {
        url: HOST + 'admin/other/make-all-as-read',
        method: 'get'
    };

    // help ------------------------------------------------
    static HELP_LIST = {
        url: HOST + 'admin/help/list',
        method: 'get'
    };
    static HELP_CATEGORY_LIST = {
        url: HOST + 'admin/help/category-list',
        method: 'get'
    };
    static HELP_DELETE = {
        url: HOST + 'admin/help/delete',
        method: 'get'
    };
    static HELP_SAVE = {
        url: HOST + 'admin/help/save',
        method: 'post'
    };
    static HELP_CATEGORY_SAVE = {
        url: HOST + 'admin/help/category-save',
        method: 'post'
    };

    // services ----------------
    static SERVICES_CATEGORY_LIS = {
        url: HOST + 'admin/brand/service-category-list',
        method: 'get'
    };

    static SERVICES_SAVE = {
        url: HOST + 'admin/brand/save-services',
        method: 'post'
    };


    // vip ---------------------
    static VIP_USER_LIST = {
        url: HOST + 'admin/vip/vip-list',
        method: 'get'
    };

    static VIP_USER_SAVE = {
        url: HOST + 'admin/vip/save-vip-user',
        method: 'post'
    };

    static VIP_USER_STAT = {
        url: HOST + 'admin/vip/stat',
        method: 'get'
    };


    // operation --------------
    // 轮播图列表
    static OPERATION_NOTICE_LIST = {
        url: HOST + 'admin/operation/notice-list',
        method: 'get'
    };

    // 轮播图修改
    static OPERATION_NOTICE_SAVE = {
        url: HOST + 'admin/operation/notice-save',
        method: 'post'
    };

    static OPERATION_NOTICE_SORT = {
        url: HOST + 'admin/operation/notice-sort',
        method: 'post'
    };

    static OPERATION_NOTICE_DELETE = {
        url: HOST + 'admin/operation/notice-delete',
        method: 'get'
    };

    static STATISTIC_ORDER_STAT = {
        url: HOST + 'admin/statistic/order-stat',
        method: 'get'
    };

    static STATISTIC_USER_STAT = {
        url: HOST + 'admin/statistic/user-stat',
        method: 'get'
    };

    static STATISTIC_ORDER_BRAND = {
        url: HOST + 'admin/statistic/order-of-brand-stat',
        method: 'get'
    };

    static STATISTIC_ORDER_SERVICES = {
        url: HOST + 'admin/statistic/order-of-service-stat',
        method: 'get'
    };

    static STATISTIC_ORDER_BRIEF = {
        url: HOST + 'admin/statistic/order-of-brief',
        method: 'get'
    };

    static CONTENT_HOME_AD_LIST = {
        url: HOST + 'admin/content/home-ad-list',
        method: 'get'
    };

    static CONTENT_HOME_AD_SAVE = {
        url: HOST + 'admin/content/home-ad-save',
        method: 'post'
    };

    static CONTENT_HOME_AD_SORT = {
        url: HOST + 'admin/content/home-ad-sort',
        method: 'post'
    };

    static CONTENT_HOME_AD_DELETE = {
        url: HOST + 'admin/content/home-ad-delete',
        method: 'get'
    };

    static CONTENT_MESSAGE_UNREAD = {
        url: HOST + 'admin/content/un-read-message',
        method: 'get'
    };

    static CONTENT_MESSAGE_UNREAD_COUNT = {
        url: HOST + 'admin/content/un-read-message-count',
        method: 'get'
    };

    static CONTENT_MESSAGE_MAKE_AS_READ = {
        url: HOST + 'admin/content/make-as-read',
        method: 'post'
    };

    static CONTENT_MESSAGE_SET_LIST = {
        url: HOST + 'admin/content/message-set-list',
        method: 'get'
    };

    static CONTENT_MESSAGE_SET_SAVE = {
        url: HOST + 'admin/content/message-set-save',
        method: 'post'
    };
}

